.scopes {
  margin-bottom: 0;

  dd {
    margin-bottom: 0;
  }

  &.grouped {
    background: #fafafa;

    dd {
      padding: 0.375rem 0.5rem 0.375rem;
    }

    @include media-breakpoint-up(md) {
      display: grid;
      grid-template-columns: auto 1fr;
    }

    @include media-breakpoint-down(md) {
      .scope-group-empty:first-child {
        display: none;
      }
    }
  }

  &.columns {
    grid-template-rows: auto 1fr;
    grid-auto-flow: column;

    overflow-x: auto;
  }
}

.scope-group {
  line-height: 2;
  font-size: 0.75rem;
  padding: 0.5rem 1rem 0.25rem 0.75rem;

  background: #f7f7f7;
}

.scope-list {
  list-style: none;

  display: flex;
  flex-wrap: wrap;

  gap: 0.25rem 0.35rem;

  position: relative;
  align-items: center;

  margin-bottom: 0;
  padding: 0;
}

.scope {
  display: inline-block;

  background-color: $scope-bg;

  font-size: 0.6875rem;
  font-weight: normal;
  white-space: nowrap;

  border-radius: 50rem;
  padding: $scope-padding;

  &, &:hover, &:focus {
    color: $scope-color;
  }

  &:hover, &:focus {
    background-color: $scope-hover-bg;
    text-decoration: none;
  }

  &.active {
    &, &:hover, &:focus, strong {
      color: $scope-active-color;
    }

    &, &:hover, &:focus {
      background-color: $scope-active-bg;
    }
  }

  strong {
    font-weight: 500;
    color: $scope-label-color;
  }
}
